package com.k.base.jdk.functions.demo3;

public class DataSourceConfig {
    private String url;
    private String username;
    private String password;

    public DataSourceConfig() {
    }

    public DataSourceConfig(String url, String username, String password) {
        this.url = url;
        this.username = username;
        this.password = password;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
    public static Builder newBuilder(){
        return new Builder();
    }

    @Override
    public String toString() {
        return "DataSourceConfig{" +
                "url='" + url + '\'' +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                '}';
    }
    public static class Builder{
        private String url;
        private String username;
        private String password;
        public Builder setUrl(String url){
            this.url = url;
            return this;
        }
        public Builder setUsername(String username){
            this.username = username;
            return this;
        }
        public Builder setPassword(String password){
            this.password = password;
            return this;
        }
        public DataSourceConfig build(){
            return new DataSourceConfig(this.url,this.username,this.password);
        }
    }
}
